merge?
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Fri, 9 Sep 2005 10:20:25 +0000 (10:20 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Fri, 9 Sep 2005 10:20:25 +0000 (10:20 +0000)
1  2 
tools/python/xen/lowlevel/xs/xs.c

index 1b33fb6a792794bc6a1a92491b22d51c30831db6,1b33fb6a792794bc6a1a92491b22d51c30831db6..5665ad82bbf58bdb9a3219634cc7432308cf7045
@@@ -93,7 -93,7 +93,9 @@@ static PyObject *xspy_read(PyObject *se
      if (!PyArg_ParseTupleAndKeywords(args, kwds, arg_spec, kwd_spec,
                                       &path))
          goto exit;
++    Py_BEGIN_ALLOW_THREADS
      xsval = xs_read(xh, path, &xsval_n);
++    Py_END_ALLOW_THREADS
      if (!xsval) {
          val = pyvalue_int(0);
          goto exit;
@@@ -140,7 -140,7 +142,9 @@@ static PyObject *xspy_write(PyObject *s
        flags |= O_CREAT;
      if (excl)
        flags |= O_EXCL;
++    Py_BEGIN_ALLOW_THREADS
      xsval = xs_write(xh, path, data, data_n, flags);
++    Py_END_ALLOW_THREADS
      val = pyvalue_int(xsval);
   exit:
      return val;
@@@ -170,7 -170,7 +174,9 @@@ static PyObject *xspy_ls(PyObject *self
        goto exit;
      if (!PyArg_ParseTupleAndKeywords(args, kwds, arg_spec, kwd_spec, &path))
          goto exit;
++    Py_BEGIN_ALLOW_THREADS
      xsval = xs_directory(xh, path, &xsval_n);
++    Py_END_ALLOW_THREADS
      if (!xsval) {
          val = pyvalue_int(0);
          goto exit;
@@@ -204,7 -204,7 +210,9 @@@ static PyObject *xspy_mkdir(PyObject *s
        goto exit;
      if (!PyArg_ParseTupleAndKeywords(args, kwds, arg_spec, kwd_spec, &path))
          goto exit;
++    Py_BEGIN_ALLOW_THREADS
      xsval = xs_mkdir(xh, path);
++    Py_END_ALLOW_THREADS
      val = pyvalue_int(xsval);
   exit:
      return val;
@@@ -232,7 -232,7 +240,9 @@@ static PyObject *xspy_rm(PyObject *self
        goto exit;
      if (!PyArg_ParseTupleAndKeywords(args, kwds, arg_spec, kwd_spec, &path))
          goto exit;
++    Py_BEGIN_ALLOW_THREADS
      xsval = xs_rm(xh, path);
++    Py_END_ALLOW_THREADS
      val = pyvalue_int(xsval);
   exit:
      return val;
@@@ -263,7 -263,7 +273,9 @@@ static PyObject *xspy_get_permissions(P
        goto exit;
      if (!PyArg_ParseTupleAndKeywords(args, kwds, arg_spec, kwd_spec, &path))
          goto exit;
++    Py_BEGIN_ALLOW_THREADS
      perms = xs_get_permissions(xh, path, &perms_n);
++    Py_END_ALLOW_THREADS
      if (!perms) {
          PyErr_SetFromErrno(PyExc_RuntimeError);
          goto exit;
@@@ -339,7 -339,7 +351,9 @@@ static PyObject *xspy_set_permissions(P
          if (p_write)
            xsperms[i].perms |= XS_PERM_WRITE;
      }
++    Py_BEGIN_ALLOW_THREADS
      xsval = xs_set_permissions(xh, path, xsperms, xsperms_n);
++    Py_END_ALLOW_THREADS
      val = pyvalue_int(xsval);
   exit:
      Py_XDECREF(tuple0);
@@@ -381,7 -381,7 +395,9 @@@ static PyObject *xspy_watch(PyObject *s
          goto exit;
      Py_INCREF(token);
      sprintf(token_str, "%li", (unsigned long)token);
++    Py_BEGIN_ALLOW_THREADS
      xsval = xs_watch(xh, path, token_str);
++    Py_END_ALLOW_THREADS
      if (!xsval) {
        val = PyErr_SetFromErrno(PyExc_RuntimeError);
        Py_DECREF(token);
@@@ -429,7 -429,7 +445,9 @@@ static PyObject *xspy_read_watch(PyObje
        goto exit;
      if (!PyArg_ParseTupleAndKeywords(args, kwds, arg_spec, kwd_spec))
          goto exit;
++    Py_BEGIN_ALLOW_THREADS
      xsval = xs_read_watch(xh);
++    Py_END_ALLOW_THREADS
      if (!xsval) {
        val = PyErr_SetFromErrno(PyExc_RuntimeError);
        goto exit;
@@@ -479,7 -479,7 +497,9 @@@ static PyObject *xspy_acknowledge_watch
      if (!PyArg_ParseTupleAndKeywords(args, kwds, arg_spec, kwd_spec, &token))
          goto exit;
      sprintf(token_str, "%li", (unsigned long)token);
++    Py_BEGIN_ALLOW_THREADS
      xsval = xs_acknowledge_watch(xh, token_str);
++    Py_END_ALLOW_THREADS
      if (!xsval) {
        val = PyErr_SetFromErrno(PyExc_RuntimeError);
        goto exit;
@@@ -519,7 -519,7 +539,9 @@@ static PyObject *xspy_unwatch(PyObject 
                                     &token))
          goto exit;
      sprintf(token_str, "%li", (unsigned long)token);
++    Py_BEGIN_ALLOW_THREADS
      xsval = xs_unwatch(xh, path, token_str);
++    Py_END_ALLOW_THREADS
      if (!xsval)
        val = PyErr_SetFromErrno(PyExc_RuntimeError);
      else {
@@@ -561,7 -561,7 +583,9 @@@ static PyObject *xspy_transaction_start
        goto exit;
      if (!PyArg_ParseTupleAndKeywords(args, kwds, arg_spec, kwd_spec, &path))
          goto exit;
++    Py_BEGIN_ALLOW_THREADS
      xsval = xs_transaction_start(xh, path);
++    Py_END_ALLOW_THREADS
      val = pyvalue_int(xsval);
   exit:
      return val;
@@@ -591,7 -591,7 +615,9 @@@ static PyObject *xspy_transaction_end(P
        goto exit;
      if (!PyArg_ParseTupleAndKeywords(args, kwds, arg_spec, kwd_spec, &abort))
          goto exit;
++    Py_BEGIN_ALLOW_THREADS
      xsval = xs_transaction_end(xh, abort);
++    Py_END_ALLOW_THREADS
      val = pyvalue_int(xsval);
   exit:
      return val;
@@@ -627,7 -627,7 +653,9 @@@ static PyObject *xspy_introduce_domain(
      if (!PyArg_ParseTupleAndKeywords(args, kwds, arg_spec, kwd_spec,
                                       &dom, &page, &port, &path))
          goto exit;
++    Py_BEGIN_ALLOW_THREADS
      xsval = xs_introduce_domain(xh, dom, page, port, path);
++    Py_END_ALLOW_THREADS
      val = pyvalue_int(xsval);
   exit:
      return val;
@@@ -658,7 -658,7 +686,9 @@@ static PyObject *xspy_release_domain(Py
      if (!PyArg_ParseTupleAndKeywords(args, kwds, arg_spec, kwd_spec,
                                       &dom))
          goto exit;
++    Py_BEGIN_ALLOW_THREADS
      xsval = xs_release_domain(xh, dom);
++    Py_END_ALLOW_THREADS
      val = pyvalue_int(xsval);
   exit:
      return val;
@@@ -718,7 -718,7 +748,9 @@@ static PyObject *xspy_shutdown(PyObjec
        goto exit;
      if (!PyArg_ParseTupleAndKeywords(args, kwds, arg_spec, kwd_spec))
          goto exit;
++    Py_BEGIN_ALLOW_THREADS
      xsval = xs_shutdown(xh);
++    Py_END_ALLOW_THREADS
      val = pyvalue_int(xsval);
   exit:
      return val;